#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMessageBox>
#include <QTcpServer> //监听套接字
#include <QTcpSocket> //通信套接字//对方的(客户端的)套接字(通信套接字)
#include <QtNetwork>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void Sleep(int msec);
private slots:

    void on_creatClient_clicked();
    void readMessage();  //接收数据
    //void sendMessage();
    void connectSuccess();
    void on_send_clicked();

    void on_creatServer_clicked();

    void on_carForward1_clicked();

    void on_carForward2_clicked();

    void on_carForward3_clicked();

    void on_clearReceieve_clicked();

private:
    Ui::MainWindow *ui;
    QTcpSocket *tcpSocket;
    QTcpServer *tcpServer;
    QString message;  //存放从服务器接收到的字符串
    quint16 blockSize; //存放文件的大小信息
    QVector<QTcpSocket*> arraySocket;
};
#endif // MAINWINDOW_H
